<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>


<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
        <span aria-hidden="true">&times;</span></button>
    <h4 class="modal-title">升降级</h4>
</div>
<div class="modal-body">

    <div class="form-horizontal row">
        <form id="form_data">
            <div id="div_error" class="col-sm-12"></div>

            <input type="hidden" name="id" value="${expertCertificate.id}">
            <div class="form-group col-sm-12">
                <label class="control-label col-sm-4">专家姓名：</label>
                <div class="col-sm-5">
                    <input type="text" disabled class="form-control" value="${expertName}">
                </div>
            </div>
            <div class="form-group col-sm-12">
                <label class="col-sm-4 control-label">类　　型：</label>
                <div class="col-sm-5">
                    <select id="itemFk" class="form-control" name="grade" >
                        <option value="">&nbsp;</option>
                        <option <c:if test="${expertCertificate.grade=='AA'}"> selected</c:if> value="AA">AA</option>
                        <option <c:if test="${expertCertificate.grade=='A'}"> selected</c:if> value="A">A</option>
                        <option <c:if test="${expertCertificate.grade=='B'}"> selected</c:if> value="B">B</option>
                        <option <c:if test="${expertCertificate.grade=='C'}"> selected</c:if> value="C">C</option>
                    </select>
                </div>
            </div>

            <div class="form-group col-sm-12">
                <div class="col-sm-5 col-sm-offset-4">
                    <button type="submit"
                            class="btn btn-default btn-success  "><span
                            class="glyphicon glyphicon-ok"></span>&nbsp;确&nbsp;定&nbsp;
                    </button>
                </div>
            </div>

        </form>


    </div>
</div>

<script>

    var $form_data = $("#form_data");
    <%--bootstrapValidator--%>
    $form_data.bootstrapValidator({
        feedbackIcons: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {
            grade: {
                validators: {
                    notEmpty: {
                        message: '不能为空！'
                    }
                }
            }
        }
    }).on('success.form.bv', function (e) {
        e.preventDefault();
        $.sysPlugin.superAjax({
            data: $(e.target).serialize(),
            url: '${url}',
            operateType: '${operateType}',
            showSuccessAlert: true,
            showWarnAlert: false,
            successCall: function (data) {
                $.sysPlugin.successCallBack(data, {
                    modal: $("#modal_ajax"),
                    table: $("#table_data")
                })
            },
            errorCall: function (data) {
                $.sysPlugin.errorCallBack(data, {
                    form: $form_date
                })
            }
        });

    });

    $.sysPlugin.initSimpleSelect2();

</script>
